﻿<shared:WindowBase x:Class="HP.Cachalote.WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:userControls="clr-namespace:HP.Cachalote.WPF.UserControls"
        xmlns:shared="clr-namespace:HP.Cachalote.WPF.Shared"
        xmlns:ignore="http://www.ignore.com"
        mc:Ignorable="d ignore"
        x:Name="Window"
        Height="600"
        Width="1000"
        MinWidth="1000"
        MinHeight="600"
        Title="Cachalote Todo"
        Icon="/Resources/Images/Cachalote-Todo.ico"
        WindowStartupLocation="CenterScreen"
        BorderThickness="1"
        BorderBrush="#0000ff"
        Background="#eeeeee"
        WindowStyle="None" 
        AllowsTransparency="True"
        StateChanged="Window_StateChanged"
        ResizeMode="CanResizeWithGrip"
        DataContext="{Binding Main, Source={StaticResource Locator}}">
    <Window.Style>
        <Style TargetType="{x:Type Window}">
            <Style.Triggers>
                <Trigger Property="IsActive" Value="True">
                    <Setter Property="BorderThickness" Value="10" />
                </Trigger>
            </Style.Triggers>
            <!--<Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,6">
                        <GradientStop Color="#017acc" Offset="0.0" />
                        <GradientStop Color="Transparent" Offset="0.25" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>-->
        </Style>
    </Window.Style>
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid x:Name="MainGrid" Margin="0,10,0,0">
        <Grid.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </Grid.RenderTransform>
        <!-- System Button Grid -->
        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-5,0,0">
            <Grid.ColumnDefinitions>
                <!-- Option Button -->
                <ColumnDefinition Width="Auto" />
                <!-- Minimize Button -->
                <ColumnDefinition Width="Auto" />
                <!-- Maximize or Restore Button -->
                <ColumnDefinition Width="Auto" />
                <!-- Close Button -->
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Button Content="?" Width="30" Height="30" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="18" FontWeight="Bold" Click="BtnAbout_Click" />
            <Button Grid.Column="1"  Name="BtnMinimize" Width="42" Height="34" ToolTip="Minimize" Style="{StaticResource ImageButton}"  Click="BtnMinimize_Click" />
            <Button Grid.Column="2"  Name="BtnMaximize" Width="42" Height="34" ToolTip="Maximize" Style="{StaticResource ImageButton}"  Click="BtnMaximize_Click" />
            <Button Grid.Column="2"  Name="BtnRestore" Width="42" Height="34" ToolTip="Restore" Style="{StaticResource ImageButton}" Visibility="Hidden"  Click="BtnRestore_Click" />
            <Button Grid.Column="3"  Name="BtnClose" Width="42" Height="34" ToolTip="Close" Style="{StaticResource ImageButton}"  Click="BtnClose_Click" />
        </Grid>
        <Grid Margin="10,0,10,10">
			<Grid.RowDefinitions>
				<!-- Icon, Title -->
				<RowDefinition Height="Auto" />
				<!-- Summary Message Display -->
				<RowDefinition Height="Auto" />
				<!-- Main Content Grid -->
				<RowDefinition />
			</Grid.RowDefinitions>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Image Source="/Resources/Images/Cachalote-Todo.ico" Width="66" Height="66" />
                <TextBlock Grid.Column="1" Margin="2,10,0,0"  Padding="4" FontSize="30" Text="CACHALOTE TODO" />
                <userControls:TodoItemSearcherUserControl Grid.Column="2" Height="26" Width="220" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,2" />
            </Grid>
            <userControls:SummaryMessageDisplayUserControl Grid.Row="1" Margin="0,4,0,4" />
			<Grid Grid.Row="2">
				<Grid.ColumnDefinitions>
					<!-- Filter & Label List -->
					<ColumnDefinition Width="Auto" />
					<!-- Left Panel Visibility Control -->
					<ColumnDefinition Width="Auto" />
					<!-- Unfinished & Finished TodoItem List -->
					<ColumnDefinition />
				</Grid.ColumnDefinitions>
				<Grid x:Name="LeftPanelGrid" Width="220">
					<Grid.RowDefinitions>
						<!-- Filter List -->
						<RowDefinition Height="150" />
						<!-- Label List -->
						<RowDefinition />
					</Grid.RowDefinitions>
					<userControls:TodoItemFilterUserControl Margin="0,5,5,0" />
					<userControls:TodoLabelTreeViewUserControl Margin="0,5,5,0" Grid.Row="1" />
				</Grid>
				<Button Margin="2,5,2,0" Grid.Column="1" Width="8" Click="leftPanelVisibilityControlButton_Click" Style="{DynamicResource LeftPanelVisibilityControlButton}" />
                <Grid Grid.Column="2" Margin="6,1,0,0">
                    <Grid.RowDefinitions>
                        <!-- Unfinished TodoItem List -->
                        <RowDefinition Height="*" />
                        <!-- Finished TodoItem List -->
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <userControls:UnfinishedTodoItemTreeViewUserControl Background="White" Margin="0,4,0,0" Padding="6" />
                    <userControls:FinishedTodoItemTreeViewUserControl Grid.Row="1" Background="White" Padding="6" />
                </Grid>
            </Grid>
		</Grid>
    </Grid>
</shared:WindowBase>